#include "dialog.h"
#include "ui_dialog.h"
#include<QMessageBox>
#include"operationwidget.h"

Dialog::Dialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Dialog)
{
    ui->setupUi(this);

    this->setWindowTitle("登录");
    ui->label->setPixmap(QPixmap(":/picture/register"));
    //setScaledContents:图片自适应控件大小
    ui->label->setScaledContents(true);
    //密码输入的时候显示圆点
    ui->lineEdit_4->setEchoMode(QLineEdit::Password);
    //固定窗口大小
    this->setFixedSize(size());
}

Dialog::~Dialog()
{
    delete ui;
}

void Dialog::on_pushButton_3_clicked()
{
    if(ui->lineEdit_3->text()=="111" && ui->lineEdit_4->text()=="123456")
    {
       operationWidget * widget =new  operationWidget;
       this->close();
       widget->show();
    }
    else
    {
        QMessageBox::information(this,"error","账号密码输入错误");
    }
}

void Dialog::on_pushButton_4_clicked()
{
    this->reject();
}
